package io.renren.modules.lucky.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.renren.common.service.impl.CrudServiceImpl;
import io.renren.modules.lucky.dao.LuckyBillDao;
import io.renren.modules.lucky.dto.LuckyBillDTO;
import io.renren.modules.lucky.entity.LuckyBillEntity;
import io.renren.modules.lucky.service.LuckyBillService;
import cn.hutool.core.util.StrUtil;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.Map;

/**
 * 招财猫结算记录
 *
 * @author Liang Pei 
 * @since 1.0.0 2025-01-06
 */
@Service
public class LuckyBillServiceImpl extends CrudServiceImpl<LuckyBillDao, LuckyBillEntity, LuckyBillDTO> implements LuckyBillService {

    @Override
    public QueryWrapper<LuckyBillEntity> getWrapper(Map<String, Object> params){
        String id = (String)params.get("id");

        QueryWrapper<LuckyBillEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StrUtil.isNotBlank(id), "id", id);

        return wrapper;
    }


    @Override
    public BigDecimal querySettlementAmount(String platCode) {

        return baseDao.querySettlementAmount(platCode);
    }

    @Override
    public BigDecimal queryPaidAmount(String platCode) {
        return baseDao.queryPaidAmount(platCode);
    }
}